package com.sss.gsb.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sss.gsb.orm.model.BondsMan;
import com.sss.gsb.orm.repository.BondsManRepository;
import com.sss.gsb.service.GSBService;
import com.sss.gsb.service.GSBServiceException;
import com.sss.gsb.service.LoadParameter;

@Service
public class BondsManService implements GSBService<BondsMan> {

	@Autowired
	BondsManRepository repo;

	@Override
	public List<BondsMan> loadData(LoadParameter param) throws Exception {
		try {
			List<BondsMan> result = repo.findByCriteria(param.getIdCard(),
					param.getName(), param.getSurname(), param.getCpk(),
					param.getCps());
			return result;
		} catch (Exception e) {
			throw new GSBServiceException(e);
		}
	}

}
